trait Logger{
  def log(message:String):Unit={
    println(message)  
  }
}

class Calculator extends Logger{
  def add(x:Int,y:Int):Unit={
    log(s"Adding $x and $y.Result:${x+y}")
  }
  def subtract(x:Int,y:Int):Unit={
    log(s"Subtracting $y from $x.Result:${x-y}")
  }
}

object Test{
  def main(args:Array[String]){
    val calculator=new Calculator()
    calculator.add(10,5)
    calculator.subtract(10,5)
  }
}
